home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra_2 / nadir11.zip / PRT.N < prev    next >
Text File  |  1995-11-08  |  3KB  |  81 lines

  1. If(0)
  2.  
  3.     PRINTER PARAMETERS IN PARM FILE
  4.  
  5.     code is the code for the printer
  6.  
  7.     prt^[code]^name     = printer name of filename that report is written to
  8.     prt^[code]^copies   = number of copies
  9.     prt^[code]^append   = whether file is appended (default to overwrite)
  10.     prt^[code]^browse   = if set, user can browse file before printing
  11.  
  12.     page^[code]^height          = length of page in lines
  13.     page^[code]^width           = width of page in character positions
  14.     page^[code]^margin^top      = top margin, in lines
  15.     page^[code]^margin^bottom   = bottom margin, in lines
  16.     page^[code]^margin^left     = left margin, in char positions
  17.     page^[code]^margin^right    = right margin, in char positions
  18.  
  19. Endif
  20. If(0)
  21.     Following Eval will initialize the contents of the parm file
  22.     with some default values
  23. Endif
  24. Eval {
  25.     parm^prt^def^name   = "";
  26.     parm^prt^def^copies = 1;
  27.     parm^prt^def^append = "";
  28.     parm^prt^def^browse = "b";
  29.     parm^page^def^height = 66;
  30.     parm^page^def^width  = 132;
  31.     parm^page^def^margin^top    = 3;
  32.     parm^page^def^margin^bottom = 3;
  33.     parm^page^def^margin^left   = 0;
  34.     parm^page^def^margin^right  = 0;
  35. }
  36. Define PrinterSetup(code, desc)
  37. {
  38.     title = "Printer Setup";
  39.     if (desc)
  40.         title = StrCat(title, " - ", desc);
  41.     if (!(prt = code))
  42.         prt = "def";
  43.  
  44.     scr = SdCreate(, -1, -1, 16, 72, title);
  45.     SdPrompt(scr, 1, 2, "Printer Name  :", "p");
  46.     SdString(scr, "",   1,  1, 18, 40, &parm^prt^[prt]^name);
  47.     SdPrompt(scr, 3, 2, "No of copies  :", "c");
  48.     SdInt   (scr, "",   1,  3, 18, 3, &parm^prt^[prt]^copies);
  49.     SdCheck (scr, "", 1, 3, 28, 26, &parm^prt^[prt]^append, "Append when outputting", "a");
  50.     SdCheck (scr, "", 1, 4, 28, 26, &parm^prt^[prt]^browse, "Browse before printing", "b");
  51.  
  52.     SdPrompt(scr, 6, 2, "Page  Height  :", "h");
  53.     SdInt   (scr, "",   1,  6, 18, 3, &parm^page^[prt]^height);
  54.     SdPrompt(scr, 6,28, "Width  :");
  55.     SdInt   (scr, "",   1,  6, 37, 3, &parm^page^[prt]^width);
  56.  
  57.     SdPrompt(scr, 8, 2, "Margins");
  58.     SdPrompt(scr, 8,11, "Top  :", "t");
  59.     SdInt   (scr, "",   1,  8, 18, 3, &parm^page^[prt]^margin^top);
  60.     SdPrompt(scr, 8,28, "Bottom :");
  61.     SdInt   (scr, "",   1,  8, 37, 3, &parm^page^[prt]^margin^bottom);
  62.  
  63.     SdPrompt(scr, 9,11, "Left :", "l");
  64.     SdInt   (scr, "",   1,  9, 18, 3, &parm^page^[prt]^margin^left);
  65.     SdPrompt(scr, 9,28, "Right  :");
  66.     SdInt   (scr, "",   1,  9, 37, 3, &parm^page^[prt]^margin^right);
  67.  
  68.     SdPrompt(scr,11, 2, "Start Seq Lit :", "s");
  69.     SdString(scr, "",   1, 11, 18, 50, &parm^prt^[prt]^start, 80, "Literal");
  70.     SdPrompt(scr,12, 2, "End Seq Lit   :", "e");
  71.     SdString(scr, "",   1, 12, 18, 50, &parm^prt^[prt]^end, 80, "Literal");
  72.  
  73.     SdButton(scr, "", 1,    14, 41, 10, "OK",     "", 1);
  74.     SdButton(scr, "", 1,    14, 55, 10, "Cancel", "", 2);
  75.  
  76.     if (SdEdit(scr) == 1)
  77.         SdUpdate(scr);
  78.  
  79.     SdDestroy(scr);
  80. }
  81.